package com.molichuxing.services.business.dto.response;

import com.molichuxing.framework.dto.ResponseRootDto;
import com.molichuxing.services.property.OrderExclusivelStatusEnum;
import com.molichuxing.services.property.OrderRenegeCostTypeEnum;
import com.molichuxing.services.property.OrderRenegeStatusEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单退租信息dto
 *
 * @author zoumingyu
 * @date 2020年2月27日
 */
@Data
public class OrderRenegeBizDto extends ResponseRootDto {
    private static final long serialVersionUID = -5932333293019688793L;

    /**
     * id
     */
    private Integer id;

    /**
     * 订单号 order_code
     */
    private Long orderCode;

    /**
     * 用户id user_id
     */
    private Integer userId;

    /**
     * 退租前订单状态（12: 待提车, 13: 用车中） before_order_status
     */
    private OrderExclusivelStatusEnum beforeOrderStatus;

    /**
     * 退租时间 renege_time
     */
    private LocalDateTime renegeTime;

    /**
     * 退租状态（0：取消退租，1：退租中，2：退租完成） renege_status
     */
    private OrderRenegeStatusEnum renegeStatus;

    /**
     * 费用类型（1：我司应收，2：我司应退） cost_type
     */
    private OrderRenegeCostTypeEnum costType;

    /**
     * 费用金额 cost_amount
     */
    private BigDecimal costAmount;

    /**
     * 费用添加时间 cost_time
     */
    private LocalDateTime costTime;

    /**
     * 退款收款人 payee
     */
    private String payee;

    /**
     * 开户行 bank
     */
    private String bank;

    /**
     * 收款银行账号 bank_number
     */
    private String bankNumber;

    /**
     * 退款人添加时间 payee_time
     */
    private LocalDateTime payeeTime;

    public OrderRenegeBizDto setBeforeOrderStatus(Integer beforeOrderStatus) {
        this.beforeOrderStatus = beforeOrderStatus == null ? null
                : OrderExclusivelStatusEnum.getEnum(beforeOrderStatus);
        return this;
    }

    public OrderRenegeBizDto setBeforeOrderStatus(OrderExclusivelStatusEnum beforeOrderStatus) {
        this.beforeOrderStatus = beforeOrderStatus;
        return this;
    }

    public OrderRenegeBizDto setRenegeStatus(Integer renegeStatus) {
        this.renegeStatus = renegeStatus == null ? null : OrderRenegeStatusEnum.getEnum(renegeStatus);
        return this;
    }

    public OrderRenegeBizDto setRenegeStatus(OrderRenegeStatusEnum renegeStatus) {
        this.renegeStatus = renegeStatus;
        return this;
    }

    public OrderRenegeBizDto setCostType(Integer costType) {
        this.costType = costType == null ? null : OrderRenegeCostTypeEnum.getEnum(costType);
        return this;
    }

    public OrderRenegeBizDto setCostType(OrderRenegeCostTypeEnum costType) {
        this.costType = costType;
        return this;
    }
}
